#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QActionGroup>
#include "configparams.h"
#include "cardutil.h"

const uint ERROR_NO_ERROR = 0U;
const uint ERROR_NO_CARD = 1U;
const uint ERROR_VERSION_MISMATCH = 256U;

class CardInfo{
public:
    CardInfo(int id) : mId(id){}
    int mId = 0;
    QString sn;
    QString type;
};

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    /**
     * @brief loadCards 加载控制卡
     */
    bool loadCards();

private slots:
    void slot_rctActionTriggered(QAction *action);

    void on_pushButton_loadfile_clicked();

    void on_pushButton_flyRun_clicked();

    void on_pushButton_flyCalc_clicked();

    void on_pushButton_mark_clicked();

    bool mark(QList<MarkerPath> list, bool flyCorr, bool fly);

    void slot_markStart(int);

    void slot_markFinished(int, int, int);

    void slot_logMessage(int, QString);

    void on_pushButton_stop_clicked();

    void on_pushButton_readEncoder_clicked();

    void on_pushButton_getEncoder_clicked();

    void on_checkBox_external_start_clicked(bool checked);
    
private:
    Ui::MainWindow *ui;
    QActionGroup *rtcCardsGroup;
    ConfigParams configParam;
    CardUtil* cardUtil;
    QList<CardInfo> cardInfos;
};

#endif // MAINWINDOW_H
